{% extends 'base/base.html' %}


{% block head %}


{% endblock %}

{% block page_title %}
    修改积分券
{% endblock %}

{% block main_content %}

    <form action="" method="get">
        <div class="form-group">
            <div class="row">
              <div class="col-lg-4">
                <div class="input-group">
                  <input type="text" class="form-control" name="user_id" placeholder="请输入手机号">
                  <span class="input-group-btn">
                       <input type="submit" value="立即搜索" class="btn btn-primary">
                  </span>
                </div><!-- /input-group -->
              </div>
            </div><!-- /.row -->
        </div>
    </form>

    <table class="table table-bordered">
        <thead>
            <tr>
                <th>用户名</th>
                <th>手机号</th>
                <th>订单号</th>
                <th>锁定积分券</th>
                <th>赠送积分券</th>
                <th>剩余积分券</th>
                <th>进场积分券</th>
                <th>单价</th>
                <th>商品数量</th>
                <th>进场数量</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {% for i in batch_list %}
                <tr data-id="{{ i.user_id }}" data-n_buy_now="{{ i.n_buy_now }}" data-order_id="{{ i.id }}">
                    <td>{{ i.username }}</td>
                    <td>{{ i.phone }}</td>
                    <td>{{ i.id }}</td>
                    <td>{{ i.n_buy_lock }}</td>
                    <td>{{ i.n_buy }}</td>
                    <td>{{ i.n_buy_now }}</td>
                    <td>{{ i.n_buy_now_real }}</td>
                    <td>{{ i.money }}</td>
                    <td>{{ i.goods_num }}</td>
                    <td>{{ i.come_num }}</td>
                    <td>{{ i.create_time }}</td>
                    <td>
                        <button class="btn btn-danger batch-reset">修改</button>
                         {% if i.blockade != 1 %}
                                <button class="btn btn-primary user-blockade">封号</button>
                            {% else%}
{#                                <button class="btn btn-warning btn-xs unblock">解封</button>#}
                             已封号
                         {% endif %}
                    </td>
                </tr>
            {% endfor %}

        </tbody>
    </table>
    {%if pagination%}
        <div class="pagination-link" style="text-align: center">{{ pagination.links }}</div>
    {% endif %}


    <!-- Modal -->
    <div class="modal fade" id="blockade-dialog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">封号原因</h4>
                </div>
                <div class="modal-body">
                    <form action="" class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">封号原因:</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="token" placeholder="封号原因">
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" id="save-blockade-btn">保存</button>
                </div>
            </div>
        </div>
    </div>


    <!-- Modal -->
    <div class="modal fade" id="batch-dialog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">积分券</h4>
                </div>
                <div class="modal-body">
                    <form action="" class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">剩余积分券：</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="n_buy_now" placeholder="剩余积分券">
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" id="save-batch-btn">保存</button>
                </div>
            </div>
        </div>
    </div>



{% endblock %}

{% block script %}
 <script src="{{ url_for('static',filename='js/cms_user.js') }}"></script>
 <script src="{{ url_for('static',filename='js/batch.js') }}"></script>
{% endblock %}
